#pragma once

class CSimpleContextMenu
{
private:
	CComPtr<IContextMenu3> m_icm3;
protected:
	CString m_fPath;
protected:
	virtual void PreSetMenu(HMENU menu){}
	virtual void PostSetMenu(HMENU menu){}
	virtual HRESULT ExecuteCmd(int id, HWND hWnd){return E_UNEXPECTED;}
public:
	enum{min_id = 100, max_id = 10000};
	CSimpleContextMenu(HWND hWnd, LPCTSTR path);
	HRESULT Track(int x, int y, HWND hWnd);
};

class CContextMenuExt : public CSimpleContextMenu
{
private:
	bool m_bIsFile;
	void CopyText(LPCTSTR text, HWND hWnd) const;
protected:
	void PostSetMenu(HMENU menu);
	HRESULT ExecuteCmd(int id, HWND hWnd);
public:
	CContextMenuExt(HWND hWnd, LPCTSTR path);
};
